<template>
  <div class="container flex-al mt-20">
    <!-- <build-el-bread></build-el-bread> -->
    <buildElThreeList
      @handDetails="handDetails"
      :tableData="tableData"
    ></buildElThreeList>
    <el-pagination
      style="margin: -25px 0 15px 0"
      background
      :page-size="pageSize"
      :current-page="pageNow"
      layout="prev, pager, next"
      @current-change="changePage"
      :total="total"
    ></el-pagination>
  </div>
</template>
<script>
import buildElBread from "@/components/build-el-bread";
import buildElThreeList from "@/components/build-el-three-list";
export default {
  components: {
    buildElBread,
    buildElThreeList,
  },
  data() {
    return {
      tableData: null,
      total: 0,
      pageSize: 6,
      pageNow: 1,
    };
  },
  async created() {
    await this.init(1);
  },
  methods: {
    handDetails(id, item) {
      console.log(item, "ww");
      if (item.pcJumpLink) {
        window.open(item.pcJumpLink);
      } else if (item.mobileJumpLink) {
        window.open(item.mobileJumpLink);
      } else {
        this.toPage(id, "城市公益巡讲");
      }
    },
    async init(page) {
      this.tableData = [];
      let tableData = await this.api.selectNewsList(page, this.pageSize);
      this.total = tableData.total;
      this.tableData = tableData.list;
      console.log("tableData", this.tableData);
    },
    changePage(e) {
      this.pageNow = e;
      this.init(e);
    },
  },
};
</script>
<style lang="less" scoped>
html {
  background: #eee;
}
.build-active-promember-home {
  margin-bottom: 40px;
  .promember-home-box {
    display: flex;
  }
}
</style>
